package com.shqcjd.sinopecdemomobile.ui.activity;

import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.widget.ImageView;
import android.widget.TextView;

import com.shqcjd.sinopecdemomobile.R;
import com.shqcjd.sinopecdemomobile.ui.adapter.TabLayoutViewPagerAdapter;
import com.shqcjd.sinopecdemomobile.ui.base.BaseActivity;
import com.shqcjd.sinopecdemomobile.ui.base.BasePresenter;
import com.shqcjd.sinopecdemomobile.ui.fragment.expertanswers.UnansweredFragment;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 专家解答
 */
public class ExpertAnswersActivity extends BaseActivity {


    @BindView(R.id.iv_toolbar_back)
    ImageView ivToolbarBack;
    @BindView(R.id.tv_toolbar_center)
    TextView tvToolbarCenter;
    @BindView(R.id.tab_mine_layout)
    TabLayout tabMineLayout;
    @BindView(R.id.viewpager_mine)
    ViewPager viewpagerMine;

    @Override
    protected BasePresenter createPresenter() {
        return null;
    }

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_expert_answers;
    }

    @Override
    public void initView() {
        super.initView();
        tvToolbarCenter.setText("专家解答");

        TabLayoutViewPagerAdapter adapter = new TabLayoutViewPagerAdapter(getSupportFragmentManager());
        adapter.addFragment(UnansweredFragment.newInstance("0"), "未解答");
        adapter.addFragment(UnansweredFragment.newInstance("1"), "已解答");
        viewpagerMine.setAdapter(adapter);
        tabMineLayout.setupWithViewPager(viewpagerMine);
    }


    @OnClick(R.id.iv_toolbar_back)
    public void onViewClicked() {
        finish();
    }
}
